/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.dengues.model.warehouse.impl;

import org.dengues.model.warehouse.NoteType;
import org.dengues.model.warehouse.WarehousePackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Note Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.dengues.model.warehouse.impl.NoteTypeImpl#isOpaque <em>Opaque</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.NoteTypeImpl#getPosX <em>Pos X</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.NoteTypeImpl#getPosY <em>Pos Y</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.NoteTypeImpl#getSizeH <em>Size H</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.NoteTypeImpl#getSizeW <em>Size W</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.NoteTypeImpl#getText <em>Text</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class NoteTypeImpl extends EObjectImpl implements NoteType {
    /**
     * The default value of the '{@link #isOpaque() <em>Opaque</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isOpaque()
     * @generated
     * @ordered
     */
    protected static final boolean OPAQUE_EDEFAULT = false;

    /**
     * The cached value of the '{@link #isOpaque() <em>Opaque</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isOpaque()
     * @generated
     * @ordered
     */
    protected boolean opaque = OPAQUE_EDEFAULT;

    /**
     * This is true if the Opaque attribute has been set.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     * @ordered
     */
    protected boolean opaqueESet;

    /**
     * The default value of the '{@link #getPosX() <em>Pos X</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPosX()
     * @generated
     * @ordered
     */
    protected static final int POS_X_EDEFAULT = 0;

    /**
     * The cached value of the '{@link #getPosX() <em>Pos X</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPosX()
     * @generated
     * @ordered
     */
    protected int posX = POS_X_EDEFAULT;

    /**
     * This is true if the Pos X attribute has been set.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     * @ordered
     */
    protected boolean posXESet;

    /**
     * The default value of the '{@link #getPosY() <em>Pos Y</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPosY()
     * @generated
     * @ordered
     */
    protected static final int POS_Y_EDEFAULT = 0;

    /**
     * The cached value of the '{@link #getPosY() <em>Pos Y</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPosY()
     * @generated
     * @ordered
     */
    protected int posY = POS_Y_EDEFAULT;

    /**
     * This is true if the Pos Y attribute has been set.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     * @ordered
     */
    protected boolean posYESet;

    /**
     * The default value of the '{@link #getSizeH() <em>Size H</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getSizeH()
     * @generated
     * @ordered
     */
    protected static final int SIZE_H_EDEFAULT = 0;

    /**
     * The cached value of the '{@link #getSizeH() <em>Size H</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getSizeH()
     * @generated
     * @ordered
     */
    protected int sizeH = SIZE_H_EDEFAULT;

    /**
     * This is true if the Size H attribute has been set.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     * @ordered
     */
    protected boolean sizeHESet;

    /**
     * The default value of the '{@link #getSizeW() <em>Size W</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getSizeW()
     * @generated
     * @ordered
     */
    protected static final int SIZE_W_EDEFAULT = 0;

    /**
     * The cached value of the '{@link #getSizeW() <em>Size W</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getSizeW()
     * @generated
     * @ordered
     */
    protected int sizeW = SIZE_W_EDEFAULT;

    /**
     * This is true if the Size W attribute has been set.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     * @ordered
     */
    protected boolean sizeWESet;

    /**
     * The default value of the '{@link #getText() <em>Text</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getText()
     * @generated
     * @ordered
     */
    protected static final String TEXT_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getText() <em>Text</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getText()
     * @generated
     * @ordered
     */
    protected String text = TEXT_EDEFAULT;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected NoteTypeImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return WarehousePackage.Literals.NOTE_TYPE;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isOpaque() {
        return opaque;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setOpaque(boolean newOpaque) {
        boolean oldOpaque = opaque;
        opaque = newOpaque;
        boolean oldOpaqueESet = opaqueESet;
        opaqueESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, WarehousePackage.NOTE_TYPE__OPAQUE, oldOpaque, opaque, !oldOpaqueESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void unsetOpaque() {
        boolean oldOpaque = opaque;
        boolean oldOpaqueESet = opaqueESet;
        opaque = OPAQUE_EDEFAULT;
        opaqueESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET, WarehousePackage.NOTE_TYPE__OPAQUE, oldOpaque, OPAQUE_EDEFAULT, oldOpaqueESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSetOpaque() {
        return opaqueESet;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getPosX() {
        return posX;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setPosX(int newPosX) {
        int oldPosX = posX;
        posX = newPosX;
        boolean oldPosXESet = posXESet;
        posXESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, WarehousePackage.NOTE_TYPE__POS_X, oldPosX, posX, !oldPosXESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void unsetPosX() {
        int oldPosX = posX;
        boolean oldPosXESet = posXESet;
        posX = POS_X_EDEFAULT;
        posXESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET, WarehousePackage.NOTE_TYPE__POS_X, oldPosX, POS_X_EDEFAULT, oldPosXESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSetPosX() {
        return posXESet;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getPosY() {
        return posY;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setPosY(int newPosY) {
        int oldPosY = posY;
        posY = newPosY;
        boolean oldPosYESet = posYESet;
        posYESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, WarehousePackage.NOTE_TYPE__POS_Y, oldPosY, posY, !oldPosYESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void unsetPosY() {
        int oldPosY = posY;
        boolean oldPosYESet = posYESet;
        posY = POS_Y_EDEFAULT;
        posYESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET, WarehousePackage.NOTE_TYPE__POS_Y, oldPosY, POS_Y_EDEFAULT, oldPosYESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSetPosY() {
        return posYESet;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getSizeH() {
        return sizeH;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setSizeH(int newSizeH) {
        int oldSizeH = sizeH;
        sizeH = newSizeH;
        boolean oldSizeHESet = sizeHESet;
        sizeHESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, WarehousePackage.NOTE_TYPE__SIZE_H, oldSizeH, sizeH, !oldSizeHESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void unsetSizeH() {
        int oldSizeH = sizeH;
        boolean oldSizeHESet = sizeHESet;
        sizeH = SIZE_H_EDEFAULT;
        sizeHESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET, WarehousePackage.NOTE_TYPE__SIZE_H, oldSizeH, SIZE_H_EDEFAULT, oldSizeHESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSetSizeH() {
        return sizeHESet;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getSizeW() {
        return sizeW;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setSizeW(int newSizeW) {
        int oldSizeW = sizeW;
        sizeW = newSizeW;
        boolean oldSizeWESet = sizeWESet;
        sizeWESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, WarehousePackage.NOTE_TYPE__SIZE_W, oldSizeW, sizeW, !oldSizeWESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void unsetSizeW() {
        int oldSizeW = sizeW;
        boolean oldSizeWESet = sizeWESet;
        sizeW = SIZE_W_EDEFAULT;
        sizeWESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET, WarehousePackage.NOTE_TYPE__SIZE_W, oldSizeW, SIZE_W_EDEFAULT, oldSizeWESet));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isSetSizeW() {
        return sizeWESet;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getText() {
        return text;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setText(String newText) {
        String oldText = text;
        text = newText;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, WarehousePackage.NOTE_TYPE__TEXT, oldText, text));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case WarehousePackage.NOTE_TYPE__OPAQUE:
                return isOpaque() ? Boolean.TRUE : Boolean.FALSE;
            case WarehousePackage.NOTE_TYPE__POS_X:
                return new Integer(getPosX());
            case WarehousePackage.NOTE_TYPE__POS_Y:
                return new Integer(getPosY());
            case WarehousePackage.NOTE_TYPE__SIZE_H:
                return new Integer(getSizeH());
            case WarehousePackage.NOTE_TYPE__SIZE_W:
                return new Integer(getSizeW());
            case WarehousePackage.NOTE_TYPE__TEXT:
                return getText();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case WarehousePackage.NOTE_TYPE__OPAQUE:
                setOpaque(((Boolean)newValue).booleanValue());
                return;
            case WarehousePackage.NOTE_TYPE__POS_X:
                setPosX(((Integer)newValue).intValue());
                return;
            case WarehousePackage.NOTE_TYPE__POS_Y:
                setPosY(((Integer)newValue).intValue());
                return;
            case WarehousePackage.NOTE_TYPE__SIZE_H:
                setSizeH(((Integer)newValue).intValue());
                return;
            case WarehousePackage.NOTE_TYPE__SIZE_W:
                setSizeW(((Integer)newValue).intValue());
                return;
            case WarehousePackage.NOTE_TYPE__TEXT:
                setText((String)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case WarehousePackage.NOTE_TYPE__OPAQUE:
                unsetOpaque();
                return;
            case WarehousePackage.NOTE_TYPE__POS_X:
                unsetPosX();
                return;
            case WarehousePackage.NOTE_TYPE__POS_Y:
                unsetPosY();
                return;
            case WarehousePackage.NOTE_TYPE__SIZE_H:
                unsetSizeH();
                return;
            case WarehousePackage.NOTE_TYPE__SIZE_W:
                unsetSizeW();
                return;
            case WarehousePackage.NOTE_TYPE__TEXT:
                setText(TEXT_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case WarehousePackage.NOTE_TYPE__OPAQUE:
                return isSetOpaque();
            case WarehousePackage.NOTE_TYPE__POS_X:
                return isSetPosX();
            case WarehousePackage.NOTE_TYPE__POS_Y:
                return isSetPosY();
            case WarehousePackage.NOTE_TYPE__SIZE_H:
                return isSetSizeH();
            case WarehousePackage.NOTE_TYPE__SIZE_W:
                return isSetSizeW();
            case WarehousePackage.NOTE_TYPE__TEXT:
                return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text);
        }
        return super.eIsSet(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public String toString() {
        if (eIsProxy()) return super.toString();

        StringBuffer result = new StringBuffer(super.toString());
        result.append(" (opaque: ");
        if (opaqueESet) result.append(opaque); else result.append("<unset>");
        result.append(", posX: ");
        if (posXESet) result.append(posX); else result.append("<unset>");
        result.append(", posY: ");
        if (posYESet) result.append(posY); else result.append("<unset>");
        result.append(", sizeH: ");
        if (sizeHESet) result.append(sizeH); else result.append("<unset>");
        result.append(", sizeW: ");
        if (sizeWESet) result.append(sizeW); else result.append("<unset>");
        result.append(", text: ");
        result.append(text);
        result.append(')');
        return result.toString();
    }

} //NoteTypeImpl
